package com.hnust.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.hnust.entity.User;
import com.hnust.service.UserService;
import com.hnust.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 创建人：zhangRuWang
 * 创建时间：2022/5/20
 * 描述：
 */
@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserService userService;

    @RequestMapping("/login")
    public R<User> login(User user){
        User resultUser=userService.getOne(
                new QueryWrapper<User>().eq("username",user.getUsername())
                .eq("password",user.getPassword())
        );
        return R.success(null);
    }

}
